json-insert doc fixes
authorMattias Engdegård <mattiase@acm.org>
Tue, 2 Apr 2024 15:51:38 +0000 (17:51 +0200)
committerMattias Engdegård <mattiase@acm.org>
Tue, 2 Apr 2024 17:06:39 +0000 (19:06 +0200)
* src/json.c (Fjson_insert): Precise the behaviour when the current
buffer is multibyte and unibyte, respectively.
* doc/lispref/text.texi (Parsing JSON): Refer to the right function.

doc/lispref/text.texi
src/json.c

index 90e2c6ce8827495fc45e95016b2e3adff519dc14..18f0ee88fe59f3e645913f2bbc65aa2a5cab41c5 100644 (file)
@@ -5833,7 +5833,7 @@ keyword @code{false}.  It defaults to the symbol @code{:false}.
 @defun json-insert object &rest args
 This function inserts the JSON representation of @var{object} into the
 current buffer before point.  The argument @var{args} are interpreted
-as in @code{json-parse-string}.
+as in @code{json-serialize}.
 @end defun
 
 @defun json-parse-string string &rest args
index c3244ad04d2f0346b18a796056c0e0326767b1af..0b4414956ee1582d45ea9889e05dc8e7b3fec406 100644 (file)
@@ -636,8 +636,9 @@ DEFUN ("json-insert", Fjson_insert, Sjson_insert, 1, MANY,
        NULL,
        doc: /* Insert the JSON representation of OBJECT before point.
 This is the same as (insert (json-serialize OBJECT ...)), but potentially
-faster.  See the function `json-serialize' for allowed values of
-OBJECT and ARGS.
+faster, and with the difference that Unicode characters are inserted as
+themselves into multibyte buffers, as UTF-8 bytes into unibyte buffers.
+See the function `json-serialize' for allowed values of OBJECT and ARGS.
 usage: (json-insert OBJECT &rest ARGS)  */)
   (ptrdiff_t nargs, Lisp_Object *args)
 {